package com.company.test22;

import java.util.HashSet;

/**
 * Created by Administrator on 2016.9.27.
 */
public class Test2201 {
    public static void main(String[] args) {
        HashSet<String> set1=new HashSet<>();
        HashSet<String> set2=new HashSet<>();
        String[] str1={"George","Jim","John","Blake","Kevin","Mechael"};
        String[] str2={"George","Katie","Michelle","Ryan","Kevin"};

        for(int i=0;i<str1.length;i++){
            set1.add(str1[i]);
        }

        for(int i=0;i<str2.length;i++){
            set2.add(str2[i]);
        }

        HashSet<String> a=new HashSet<>();

        for(String string:set1){
            if(set2.contains(string)){
                a.add(string);
            }
        }

        HashSet<String> b=new HashSet<>();
        for(String string:set1){
            b.add(string);
        }

        for(String sring:set2){
            b.add(sring);
        }

        HashSet<String> c=new HashSet<>();
        for(String string:set1){
            if(!set2.contains(string)){
                c.add(string);
            }
        }

        for (String string:c){
            System.out.println(string);
        }
    }
}